package com.递归2;

import java.util.Objects;

public class 回文字符串 {
    public static class Solutio{
       public static StringBuilder builder = new StringBuilder();
        public static boolean verityPlalindrome(String str){
            return Objects.equals(str,reserve(str,0));
        }
        public static String reserve(String str,int index){

            if(index >= str.length()-1){
                return str.charAt(index)+"";
            }
            reserve(str,++index);
            builder.append(str.charAt(index)+"");
            return builder.toString();
        }


        public static void main(String[] args) {
            System.out.println( verityPlalindrome("123321"));
        }

    }
}
